﻿@using Microsoft.AspNetCore.Http.Features
@inject IStringLocalizer<CloudscribeCore> sr
@{
    var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
    var hasConsented = consentFeature?.CanTrack ?? false;
    var hasDismissed = Context.Request.Cookies["cookieconsent_dismissed"] != null;
    
    // Show the link if user has made any choice (either consented or dismissed)
    var showChangePreferences = hasConsented || hasDismissed;
}
@if (showChangePreferences)
{
    <form style="display:inline" asp-controller="Privacy" asp-action="ResetCookiePreferences" method="post">
        <button type="submit" class="btn btn-link">@sr["Change cookie preferences"]</button>
    </form>
}
